Default Video Player State
Represents the state and behavior of a video player. This class provides properties and methods to control video playback, manage the playback state, and interact with platform-specific implementations.
Properties:
isPlaying: Indicates whether the video is currently playing.volume: Controls the playback volume. Valid values are within the range of 0.0 (muted) to 1.0 (maximum volume).sliderPos: Represents the current playback position as a normalized value between 0.0 and 1.0.userDragging: Denotes whether the user is manually adjusting the playback position.loop: Specifies if the video should loop when it reaches the end.positionText: Returns the current playback position as a formatted string.durationText: Returns the total duration of the video as a formatted string.
Methods:
openUri(uri: String): Opens a video file or URL for playback.play(): Starts or resumes video playback.pause(): Pauses video playback.stop(): Stops playback and resets the player state.seekTo(value: Float): Seeks to a specific playback position based on the provided normalized value.dispose(): Releases resources used by the video player and disposes of the state.
Properties
Returns the total duration of the video as a formatted string.
Callback invoked when playback reaches the end of the media. Only called when loop is false. May be invoked from a background thread.
Returns the current playback position as a formatted string.
Denotes whether the user is manually adjusting the playback position.
Functions
Clears the shared video cache, removing all cached media data from disk.
Opens a media file bundled with the application.
Opens a video file or URL for playback.
Commits the seek after a user-driven seek interaction. Performs the actual seek on the player and ends the dragging state.
Begins a user-driven seek interaction (e.g. slider drag). Updates the visual slider position without performing the actual seek on the player. Must be followed by seekFinished to commit the seek.